// pages/evaluate/evaluate.js
var app = getApp();
var ea = require('../../utils/each.js');
var time = require('../../utils/util.js');
Page({

  /**
   * 页面的初始数据
   */
  data: {
    getshijuanUrl: app.data.url + 'zhongxue/teacher/shijuan',
    shuju:{},
    evalArr:[
      {
        subject:"语文",
        url:"/img/d96aef7937cafff8f012003eaa1355e.png",
        uname:"陈雪",
        evaluate:"评价",
        evaluateUrl:"/img/xiaoix.png",
        date:"2018-06-12"
      },
      {
        subject: "语文",
        url: "/img/d96aef7937cafff8f012003eaa1355e.png",
        uname: "陈雪",
        evaluate: "评价",
        evaluateUrl: "/img/xiaoix.png",
        date: "2018-06-12"
      },
      {
        subject: "语文",
        url: "/img/d96aef7937cafff8f012003eaa1355e.png",
        uname: "陈雪",
        evaluate: "评价",
        evaluateUrl: "/img/xiaoix.png",
        date: "2018-06-12"
      },
      {
        subject: "语文",
        url: "/img/d96aef7937cafff8f012003eaa1355e.png",
        uname: "陈雪",
        evaluate: "评价",
        evaluateUrl: "/img/xiaoix.png",
        date: "2018-06-12"
      },
      {
        subject: "语文",
        url: "/img/d96aef7937cafff8f012003eaa1355e.png",
        uname: "陈雪",
        evaluate: "评价",
        evaluateUrl: "/img/xiaoix.png",
        date: "2018-06-12"
      }, 
      {
        subject: "语文",
        url: "/img/d96aef7937cafff8f012003eaa1355e.png",
        uname: "陈雪",
        evaluate: "评价",
        evaluateUrl: "/img/xiaoix.png",
        date: "2018-06-12"
      }
    ]
  },
  skip:function(e){
    // console.log(e);
    var id = e.currentTarget.dataset.id;
    wx.navigateTo({
      url: '/pages/appraisal/appraisal?id=' + id,
    })
  },

  /**
   * 生命周期函数--监听页面加载
   */

  onLoad: function (options) {
    
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    var that = this;
    // console.log(that);
    var shuju = that.data.shuju;
    var user = wx.getStorageSync('newuser');
    // console.log(user)
    var token = user.token;
    var shenhe = user.shenhe;
    wx.request({
      url: that.data.getshijuanUrl,
      method:'post',
      data:{token:token,shenhe:shenhe},
      success:function(res){
        var data = res.data;
        // console.log(data);
        if(data.code == 200){
          var shuju = data.data.data;
          console.log(shuju)
          that.setData({shuju:shuju})
        }else{
          wx.showToast({
            title: '获取失败',
            icon: 'none',
          })
        }
      }
    })
  },


  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
    this.onShow();
    wx.stopPullDownRefresh()
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
 
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})